package com.mzy.xmyx.acl.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.mzy.xmyx.model.acl.Permission;

import java.util.List;

public interface PermissionService extends IService<Permission> {

    /**
     * 查询所有菜单
     * @return List<Permission>
     */
    List<Permission> queryAllPermission();

    /**
     * 递归删除菜单
     * @param id 菜单id
     * @return Boolean
     */
    Boolean removeChildById(Long id);

    /**
     * 获取已分配的权限和所有权限
     * @param roleId 角色id
     * @return Map<String, Object>
     */
    List<Permission> getPermissionByRoleId(Long roleId);

    /**
     * 为角色授权
     * @param roleId 角色id
     * @param permissionIdList 权限ids
     * @return Boolean 是否成功
     */
    Boolean saveRolePermissionRelationship(Long roleId, List<Long> permissionIdList);
}
